<?php
class param{
	
	var $id;
	var $display;
	var $type;
	var $length;
	var $listing;
	var $field;
	var $value;
	var $option;
	var $valueDisplay;
	var $primary;
	
	function __construct($id, $display, $type){
		$this->id = $id;
		$this->display = $display;
		$this->type = $type;
	}
	
	function get_valueDisplay(){
		if($this->isCustomType()){
			$option = $this->option;
			return $option->get_optionDisplay($this->value);
		}else{
			return $this->value;
		}
	}
	
	function isCustomType(){
		$type = $this->type;
		if(substr($type, 0, 1) == '[' && substr($type, strlen($type) - 1, 1) == ']'){
			return true;
		}else{
			return false;
		}
	}
	
	function get_attribute($attr){
		if($attr == 'id'){
			return $this->id;
		}else if($attr == 'display'){
			return $this->display;
		}else if($attr == 'type'){
			return $this->type;
		}else if($attr == 'length'){
			return $this->length;
		}else if($attr == 'listing'){
			return $this->listing;
		}else if($attr == 'field'){
			return $this->field;
		}else if($attr == 'value'){
			return $this->value;
		}
	}
	
	function get_id(){
		return $this->id;
	}
	
	function get_display(){
		return $this->display;
	}
	
	function get_type(){
		return $this->type;
	}
	
	function get_length(){
		return $this->length;
	}
	
	function get_listing(){
		return $this->listing;
	}
	
	function get_field(){
		return $this->field;
	}
	
	function get_value(){
		return $this->value;
	}
	
	function get_primary(){
		return $this->primary;
	}
	
	function get_option(){
		return $this->option;
	}
	
	function set_id($id){
		$this->id = $id;
	}
	
	function set_display($display){
		$this->display = $display;
	}
	
	function set_type($type){
		$this->type = $type;
	}
	
	function set_length($length){
		$this->length = $length;
	}
	
	function set_listing($listing){
		$this->listing = $listing;
	}
	
	function set_field($field){
		$this->field = $field;
	}
	
	function set_value($value){
		$this->value = $value;
	}
	
	function set_option($option){
		$this->option = $option;
	}
	
	function set_primary($primary){
		$this->primary = $primary;
	}
	
}
?>